package com.qf.hospital.system.controller;

import com.qf.hospital.system.service.PaibanService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController
public class MainController {

    @Autowired
    private PaibanService paibanService;

    /**
     * 首页排班信息
     * # path&method
     *     Request URL: http://localhost:8080/main/paiban/{week}
     *     Request Method: POST
     * # parameter
     * 	无
     * # return
     * SUCCESS:
     * [
     *     {"doctorName": "华佗"},
     *     {"doctorName": "扁鹊"},
     *     {"doctorName": "索拉卡"},
     *     {"doctorName": "琴女"}
     * ]
     */
    @PostMapping("/main/paiban/{week}")
    public List<Map<String,Object>> paiban(@PathVariable String week){
        return paibanService.findPaibanByWeek(week);
    }

}
